/*
 * Copyright 2013 Krzysztof Smigielski
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.nilcaream.dirstore.cli;

import com.nilcaream.utilargs.model.Option;

/**
 * TODO
 * <p/>
 * Krzysztof Smigielski 3/27/13 8:24 PM
 */
public class Configuration {

    @Option(name = 'c') // update u
    private boolean createArchive;

    @Option(name = 'd')
    private boolean findDuplicates;

    @Option(name = 'v')
    private boolean verboseOutput;

    @Option(name = 'h')
    private boolean showHelp;

    @Option(name = 'i')
    private String inputName;

    @Option(name = 'o')
    private String outputName;

    @Option(name = 'p')
    private int progressBarRefreshRate;

    @Option(name = 'j')
    private int maxImageSize = 300;

    @Option(name = 'b')
    private int maxFileSize = 2000;

    @Option(name = 't')
    private double duplicateThreshold = 0;

    @Option(name = 'q')
    private boolean quickMode;

    private String operands;

    public long getDuplicateThreshold() {
        return Math.round(duplicateThreshold);
    }

    public boolean isQuickMode() {
        return quickMode;
    }

    public boolean isFindDuplicates() {
        return findDuplicates;
    }

    public void setFindDuplicates(boolean findDuplicates) {
        this.findDuplicates = findDuplicates;
    }

    public int getMaxImageSize() {
        return maxImageSize;
    }

    public void setMaxImageSize(int maxImageSize) {
        this.maxImageSize = maxImageSize;
    }

    public int getMaxFileSize() {
        return maxFileSize;
    }

    public void setMaxFileSize(int maxFileSize) {
        this.maxFileSize = maxFileSize;
    }

    public int getProgressBarRefreshRate() {
        return progressBarRefreshRate;
    }

    public void setProgressBarRefreshRate(int progressBarRefreshRate) {
        this.progressBarRefreshRate = progressBarRefreshRate;
    }

    public boolean isCreateArchive() {
        return createArchive;
    }

    public void setCreateArchive(boolean createArchive) {
        this.createArchive = createArchive;
    }

    public boolean isVerboseOutput() {
        return verboseOutput;
    }

    public void setVerboseOutput(boolean verboseOutput) {
        this.verboseOutput = verboseOutput;
    }

    public boolean isShowHelp() {
        return showHelp;
    }

    public void setShowHelp(boolean showHelp) {
        this.showHelp = showHelp;
    }

    public String getInputName() {
        return inputName;
    }

    public void setInputName(String inputName) {
        this.inputName = inputName;
    }

    public String getOutputName() {
        return outputName;
    }

    public void setOutputName(String outputName) {
        this.outputName = outputName;
    }

    public void setOperands(String operands) {
        this.operands = operands;
    }

    public String getOperands() {
        return operands;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("Configuration{");
        sb.append("createArchive=").append(createArchive);
        sb.append(", verboseOutput=").append(verboseOutput);
        sb.append(", showHelp=").append(showHelp);
        sb.append(", inputName='").append(inputName).append('\'');
        sb.append(", outputName='").append(outputName).append('\'');
        sb.append('}');
        return sb.toString();
    }
}
